import { CommonEnum } from "../Common/CommonEnum";

/**
 * 不同游戏专属枚举值
 */
export module GlobalEnum {
    export const Common = CommonEnum;

    /**各游戏自定义的全局变量名称 */
    export enum myGlobalDataType {
        /**关卡中的玩家角色脚本 */
        player,
        /**关卡中的所有敌人角色脚本 */
        enemies,
        /**管理所有2D物理引擎节点的根节点 */
        colliderLayer,
        /**匹配到的敌人数据 */
        matchEnemies,
        /**匹配到的地图名称数组 */
        matchMap,
        /**匹配到的敌人角色名称 */
        matchEnemyNames,
        /**传送门脚本数组 */
        portals,
    }

    /**UI类型，枚举值与对应UI预制件、脚本名称相同 */
    export enum UI {
        //首页
        lobby = "GameLobby",                    //首页
        shop = "ShopUI",                        //商城界面
        chooseLevel = "ChooseLevelUI",          //关卡选择页面 
        //通用
        configSetting = "ConfigSettingUI",      //设置面板
        playerAssetBar = "PlayerAssetBar",      //玩家资产信息条
        getPower = "GetPowerUI",                //获取体力界面
        tipPower = "TipPowerUI",                //体力不足提示界面
        //关卡中
        levelInfo = "LevelInfoUI",              //关卡信息
        levelController = "LevelController",    //关卡操作面板
        pauseLevel = "PauseLevelUI",            //关卡暂停面板
        trySkin = "TrySkinUI",                  //皮肤试用界面
        levelTeach = "TeachAnim",               //关卡教学界面
        match = "MatchUI",                      //角色匹配界面
        //结算页
        awardUI = "AwardUI",                    //奖励领取界面
        winUI = "WinUI",                        //胜利界面
        loseUI = "LoseUI",                      //失败界面
        resurgence = "ResurgenceUI",            //复活界面
        //砸蛋页
        touchBanner1 = "TouchBannerUI1",        //砸蛋页面
        touchBanner2 = "TouchBannerUI2",        //砸蛋页面
        touchBanner3 = "TouchBannerUI3",        //砸蛋页面
        //互推页
        littlePage = "Recommend_littlePage",    //小全导页
        middlePage = "Recommend_middlePage",    //中全导页
        bigPage = "Recommend_bigPage",          //大全导页
        recommendDialog = "RecommendDialog",    //互推弹窗
        //其他
        winNativeAdUI = "WinNativeAdUI",        //胜利界面原生广告页
        loseNativeAdUI = "LoseNativeAdUI",      //失败界面原生广告页
        //抽奖
        spin = "SpinUI",
        //观看视频获取金币页
        getGoldByVideo = "GetGoldByVideo",
    }

    /**游戏数据类型 */
    export enum GameDataType {
        /**关卡数据 */
        levelData = "LevelData",
        playerSkin = "PlayerSkin",
        RobotData = "RobotData",
        MapData = "MapData",
        WeaponAtkData = "WeaponAtkData",
        GoodsData = "GoodsData",
    }
    /**商店中商品项的类型 */
    export enum GoodsType {
        /**主角皮肤 */
        playerSkin = "PlayerSkin",
        hat = "hat",
        weapon = "weapon",
        skin = "skin",
    }

    /**音效文件 */
    export enum AudioClip {
        clickBtn = "ClickBtn",
        win = "Win",
        lose = "Lose",
        BGM = "BGM",
        BGM2 = "BGM",
        BGMLobby = "BGM",

        gold = 'Gold',
        reward = "Reward",
        //抽奖音效
        spin = "wheelSpin",
        //抽中皮肤
        getSkin = "getSkin",


        //破坏动画音效
        breakMetal = "break_metal",
        breakStones = "break_stones",
        breakWood = "break_wood",
        //击杀提示
        killDouble = "kill_double",
        killMulti = "kill_multi",
        killUltra = "kill_ultra",
        killed = "kill_good",

        //攻击音效
        atkcaptain1 = "ATK_captain",
        atkcaptain2 = "ATK_captain",
        atkcaptain3 = "ATK_captain",
        atkcaptain4 = "ATK_captain",
        atkcaptain5 = "ATK_captain",
        atkclaw1 = "ATK_claw",
        atkgun1 = "ATK_gun",
        atkgun2 = "ATK_gun",
        atkgun3 = "ATK_gun",
        atkgun4 = "ATK_gun4",
        atkhunter1 = "ATK_hunter",
        atkhunter2 = "ATK_hunter2",
        atkhunter3 = "ATK_hunter",
        atkhunter4 = "ATK_hunter4",
        atkhunter5 = "ATK_hunter",
        atkkatana1 = "ATK_kadana",
        atkkatana2 = "ATK_kadana",
        atkkatana3 = "ATK_kadana",
        atkkatana4 = "ATK_kadana",
        atkkatana5 = "ATK_kadana",
        atkkatana6 = "ATK_kadana",
        atkkatana7 = "ATK_kadana",
        atkknife1 = "ATK_knife",
        atkknife2 = "ATK_knife",
        atkknife3 = "ATK_knife",
        atkknife4 = "ATK_knife",
        atktrapper1 = "ATK_trapper",
        atktrapper2 = "ATK_trapper",
        atktrapper3 = "ATK_trapper",
        atktrapper4 = "ATK_trapper",
        atkTrapperBoom = "ATK_trapper_bomb",

    }

    /**游戏所处流程 */
    export enum DirectState {
        lobby,
        level,

    }

    export enum VideoName {

    }
    /**关卡状态 */
    export enum LevelState {
        inited = 1,     //关卡已初始化完成，但还未开始游戏
        playing,        //关卡进行中
        teaching,       //关卡处于新手教学阶段
        win,            //玩家已胜利
        lose,           //玩家已失败
        lobby,          //显示首页中
        playerEntering, //玩家登场动画
        playerDead,     //玩家失败死亡动画
        fighting,       //战斗中
        waitTrySkin,    //等待玩家选择要试用的皮肤
        portalplayer,   //将玩家传送到另一个位置
    }
    /**关卡中相机状态 */
    export enum LevelCameraState {
        follow,
    }

    /**操作按键类型 */
    export enum KeyCode {
        left = 0,
        right,
        up,
        down,

        /**仅用作获取按键类型个数 */
        count,
    }

    /**材质球渲染顺序记录在此，方便设置 */
    enum Priority {
        ground = 10,
        atkScope = 20,
        map = 30,
        barrier = 40,
        gold = 40,
        role = 50,
        weapon = 60,
        weaponSteak = 80,


    }

    /**属性变化标记 */
    export enum DirtyType {
        none = 0,
        /**坐标变化 */
        pos = (1 << 0),
        /**角度 */
        angle = (1 << 1),
        /**缩放 */
        scale = (1 << 2),
        /**自定义的碰撞范围 */
        aabb = (1 << 3),
        /**移动速度 */
        speed = (1 << 4),
        /**武器类型 */
        weaponType = (1 << 5),
        /**武器id */
        weaponId = (1 << 6),
        /**角色体型大小 */
        roleScale = (1 << 7),
        /**全部变化了，需要彻底更新 */
        all = 0xffffffff,
    }

    /**角色动画类型 */
    export enum RoleAnimType {
        stand = "idle",
        move = "walk",
        atk = "attack",
        atk0 = "attack_0",
        atk1 = "attack_1",
        atk2 = "attack_2",
        atk3 = "attack_3",
        win = "Model|Victory",
        dead = "die_claw",
    }

    /**武器类型 */
    export enum WeaponType {
        none = "none",
        /**钝器 */
        captain = "captain",
        /**双爪 */
        claw = "claw",
        /**枪 */
        gun = "gun",
        /**炮 */
        hunter = "hunter",
        /**武士刀 */
        katana = "katana",
        /**匕首 */
        knife = "knife",
        /**地雷 */
        trapper = "trapper",
    }

    /**3D节点的2D碰撞体替身名称 */
    export enum RigidNode {
        /**角色替身，为圆形动态刚体 */
        role = "RigidRole",
        /**建筑物，为多边形静态刚体 */
        build = "RigidBuild",
        /**金币，为矩形动态刚体 */
        gold = "RigidGold",

    }

    /**2D物理引擎的碰撞分组 */
    export enum RigidGroup {
        /**默认分组，用于可破坏的障碍物 */
        default = (1 << 0),
        enmey = (1 << 1),
        player = (1 << 2),
        gold = (1 << 3),
        /**地面、静态障碍物等 */
        ground = (1 << 4),

    }

    /**角色所处状态 */
    export enum RoleState {
        stand,
        move,
        /**起手 */
        atkReading,
        /**发力 */
        atkEnter,
        /**击中 */
        atking,
        /**收招 */
        atkEnd,
        /**死亡动画播放中 */
        deadAnimPlaying,
        /**死亡动画播放结束，躺尸 */
        deadAnimFinish,
        /**胜利后的得瑟过程 */
        win,
        /**跳进下水道 */
        jumpInPortal,
        /**跳出下水道 */
        jumpOutPortal,

    }

    /**关卡元素障碍物的类型 */
    export enum BarrierType {
        /**可破坏的障碍物 */
        breakBarrier,
        /**可撞开可破坏的障碍物 */
        dynamicBarrier,
        /**静止不动且无法破坏的障碍物 */
        staticBarrier,
    }

    /**使用八叉树检测的碰撞体类型 */
    export enum CollerType {
        /**障碍物 */
        barrier,
        /**角色 */
        role,
        /**攻击框，角色出招时的攻击范围 */
        atkBox,
        //其他类型：金币，加速道具等
        /**所有可拾取道具的统称，仅用于八叉树标识，不能作为具体类型 */
        props,
        /**BUFF道具 */
        buff,

    }

    /**攻击范围类型 */
    export enum AtkScopeType {
        /**矩形 */
        rect,
        /**扇形 */
        fan,
    }

    /**缓动曲线类型 */
    export enum EaseType {
        line,
        easeIn,
        easeOut,
        easeInOut,
        easeOutIn,
        sinIn,
        sinOut,
        sinInOut,
        sinOutIn,

    };

}
